import 'package:flutter/material.dart';
import 'package:flutter_music/index/header.dart';
import 'package:flutter_music/indexComponents/explore.dart';
import 'package:flutter_music/indexComponents/friend.dart';
import 'package:flutter_music/indexComponents/my.dart';
import 'package:flutter_music/indexComponents/video.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class Index extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Theme.of(context).dialogBackgroundColor,
      child: Column(
        children: <Widget>[
          Header(),
          Expanded(
            child: Swiper(
              itemBuilder: _swiperBuilder,
              itemCount: 4,
              autoplay: false,
              loop: false,
              index: 1,
              onIndexChanged: (int index) => {
                
              }
            )
          )
        ],
      )
    );
  }

  Widget _swiperBuilder(BuildContext context, int index) {
    return [My(), Explore(), Friend(), Video()][index];
  }
}